<?php
   
/**
 * Mapper for tunits
 * 
 * @author Martin Grossmann <snake.aas@gmail.com>
 * @version 1.0
 * @package Mappers
 *
 * @property string $Unit Name of assignable units. 5 chars max
 * 
 * @entity
 * @table(name="tunits")
 */     
class Unit {
  /**
   * Name of assignable units
   * 
   * @access private
   * @var string
   * 
   * @Id
   * @column(name="Unit", type="string", length=5)
   */
   private $unit;
     

  public function __get($name) {
    switch($name) {
      case "Unit": 
        return $this->unit;
        break;
      default:
        throw new EntityException(sprintf(T_("Trying to get undefined property")." ", $name));
    }
  }
  
  public function __set($name, $value) {  
    switch($name) {
      case "Unit": 
        $this->unit = Validations::validateString($value, 5, null, false);
        break; 
      default:
        throw new EntityException(sprintf(T_("Trying to set undefined property")." ", $name));
    }
  }  
  
  public function __construct() {
    
  }
}